import java.io.*;
import java.net.*;

public class Practice9_2_Server {
	public static void main(String[] args) throws UnknownHostException, IOException{
		ServerSocket server = new ServerSocket(1680);
		Socket socket = server.accept();
		PrintWriter out = new PrintWriter(socket.getOutputStream());
		BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
		String s;
		
		while(!(s=in.readLine()).equals("bye")) {
			try {
				double r = Double.valueOf(s);
				System.out.println("# Received from Client: "+r);
				out.println(r*r*Math.PI);
				out.flush();
			}catch(NumberFormatException e) {
				System.out.println("# Received from Client: "+s);
				out.println("Illegal value.");
				out.flush();
			}
		}
		 
		out.close();
		in.close();
		socket.close();
		server.close();
		System.out.println("The connection is closed.");
	}
}
